import 'package:flutter/material.dart';
import 'package:qqmusic/widget/search.dart';
import 'package:qqmusic/widget/squareitem.dart';

class squareItem extends StatefulWidget {
  squareItem({Key key, this.name}) : super(key: key);
  String name;
  @override
  State<squareItem> createState() => _squareItemState();
}

class _squareItemState extends State<squareItem>
    with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
  List<int> imgcode = [0, 1, 2, 3];
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(
        horizontal: 15,
      ),
      child: ListView.builder(
        padding: EdgeInsets.all(0),
        itemCount: 5,
        itemBuilder: (BuildContext context, int index) {
          if (index == 0) {
            return search();
          }
          return itme(
            imgcode: imgcode[index - 1],
          );
        },
      ),
    );
  }

  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive => true;
}
